﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>add changes and queries</title>

    <script type="text/javascript" src="script/jquery.min.js"></script>

    <script type="text/javascript" src="script/jquery.SPServices-0.5.4.min.js"></script>

    <script type="text/javascript" src="script/search_load.js"></script>

    <style type="text/css">
        #Description
        {
            height: 147px;
            width: 251px;
        }
    </style>
</head>
<body>

    <script type="text/javascript">

        function AddItems() {
            //create a array of submitted fields
            var fields = new Array;

            // elt =
            fields[0] = ["Title", document.getElementById("Name").value, "Text"];
            fields[1] = ["Name", document.getElementById("Name").value, "Text"];
            fields[2] = ["Category", document.getElementById("Category").value, "Lookup"];
            fields[3] = ["LoB", document.getElementById("LOB").value, "Lookup"];
            fields[4] = ["Site", document.getElementById("Site").value, "Text"];
            fields[5] = ["SubmittedBy", document.getElementById("Username").value, "Text"];
            fields[6] = ["Description", document.getElementById("Description").value, "Note"];

       
            //submit fields to list
            //Fields
            //url to webservice
            //list
            KbWorks.lists.insertitem(fields, "http://devKbWorks/HR/insert/", "Changes");
            //generate ID
            //   alert(returnedID);
            //return ID to submitter.
            var elt = document.getElementById("addItems");
            fields = new Array;
            fields[0] = ["ID", KbWorks.lists.returnedID, "Number"];
            fields[1] = ["Title", "KbWorksEC-" + KbWorks.lists.returnedID + " " + document.getElementById("Name").value, "Text"];
            KbWorks.lists.insertitem(fields, "http://devKbWorks/HR/insert/", "Changes");
            KbWorks.UI.responsetext(elt, "We received your Change it has the number " + KbWorks.lists.returnedID);

        }
    </script>

    <div id="addItems">
        <table>
            <tbody>
                <tr>
                    <td>
                        Title
                    </td>
                    <td>
                        <input id="Name" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Category
                    </td>
                    <td>
                        <select name="Category" id="Category">
                            <option value="Inquiry">Inquiry</option>
                            <option value="Change Request">Change Request</option>
                            <option value="Incident">Incident</option>
                            <option value="Site Request">Site Request</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>
                        LOB
                    </td>
                    <td>
                        <select name="LOB" id="LOB">
                            <option value="1">CC&A</option>
                            <option value="Retail ">Retail</option>
                            <option value="Commercial ">Commercial </option>
                            <option value="KbWorks Direct">KbWorks Direct</option>
                            <option value="HR">HR</option>
                            <option value="OIB"></option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>
                        Site
                    </td>
                    <td>
                        <input id="Site" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Submitted By
                    </td>
                    <td>
                        <input id="Username" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Description
                    </td>
                    <td>
                        <!--<input id="Description" />-->
                        <textarea id="Description" rows="5" cols="25" wrap="virtual"></textarea>
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td>
                        <input type="submit" value="voeg toe" onclick="AddItems()" />
                        </td>
                </tr>
            </tbody>
        </table>
        <!--title is ID
name is korte beschrijving(titel)
category
LOB
Site
Submittedby default current user + wijzigen
sumitteddate Currentdate auto genereren
status NEW
description Hun Beschrijving
-->
    </div>
</body>
</html>
